//
//  SLDBManager.m
//  SoccerLottery
//
//  Created by chuanshuangzhang chuan shuang on 15/12/25.
//  Copyright © 2015年 chuanshuangzhang. All rights reserved.
//

#import "SLDBManager.h"

@implementation SLDBManager

+ (void)saveUserAccount:(NSString *)account passcode:(NSString *)passcode
{
    if(account!=nil && passcode != nil){
        [[NSUserDefaults standardUserDefaults] setObject:@{@"account":account,@"passcode":passcode} forKey:@"account"];
        [[NSUserDefaults standardUserDefaults] synchronize];
    }
}

+ (NSDictionary *)userAccount
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:@"account"];
}

+ (void)deleteUserAccount{
    [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"account"];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

+(NSString *)feedStatus:(NSString *)feedId
{
    NSString *status = [[NSUserDefaults standardUserDefaults] objectForKey:feedId];
    if(status.length <=0)
    {
      return @"0";
    }
    return status;
}

+(void)saveFeed:(NSString *)feedId status:(NSString *)status
{
    [[NSUserDefaults standardUserDefaults]setObject:status forKey:feedId];
}

@end
